package com.copm.ifm.servers.sys.vo;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.copm.ifm.base.basic.NameTag;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.Date;
import java.util.List;

/**
 * 租户表分页返回对象
 *
 * @author tp
 * @date 2020/12/17 14:45
 */
@Setter
@Getter
@ToString
public class SysTenantVO implements Serializable, NameTag {
    private static final long serialVersionUID = 1L;

    private Long id;

    @ApiModelProperty("编号")
    private String code;

    @ApiModelProperty("名称")
    private String name;

    @ApiModelProperty("联系人姓名")
    private String contactPerson;

    @ApiModelProperty("办公电话")
    private String telNum;

    @ApiModelProperty("地址")
    private String address;

    @ApiModelProperty("是否系统管理员，0-否，1-是")
    private Integer sysAdmin;

    @ApiModelProperty("电子邮箱")
    private String email;

    @ApiModelProperty("网址")
    private String website;

    @ApiModelProperty("统一社会信用代码")
    private String creditCode;

    @ApiModelProperty("类型")
    private List<Integer> type;

    @ApiModelProperty("是否拥有所有权限[0：不是所有，1：所有权限]")
    private Integer allAuth;

    @ApiModelProperty("类型描述")
    private String typeName;

    @ApiModelProperty("状态 [1正常 2过期 3禁用]")
    private Integer status;

    @ApiModelProperty("过期时间")
    private LocalDateTime expireTime;

    @ApiModelProperty("是否有效")
    private Integer enabled;

    @ApiModelProperty("备注")
    private String remark;

    @ApiModelProperty("创建人")
    private Long createBy;

    @ApiModelProperty("创建人名")
    private String createByName;

    @TableField(fill = FieldFill.INSERT)
    @ApiModelProperty("创建时间")
    private Date createTime;

    @ApiModelProperty("修改人")
    private Long updateBy;

    @ApiModelProperty("修改人名")
    private String updateByName;

    @TableField(fill = FieldFill.INSERT)
    @ApiModelProperty("修改时间")
    private Date updateTime;

    //这块存在第一次刷新空指针异常，先用原始方法处理
//    public String getTypeName() {
//        return DictFieldFillUtil.getNames(DictCodeEnum.ORG_TYPE, type, typeName);
//    }
}